Skip to content

feat: support DinD install for Amazon Linux 2023#5

Open
gilescope wants to merge 1 commit intomainfrom
giles-add-al
Open

feat: support DinD install for Amazon Linux 2023#5
gilescope wants to merge 1 commit intomainfrom
giles-add-al

Conversation

@gilescope
Copy link

No description provided.

Signed-off-by: Giles Cope <gilescope@gmail.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request extends the DinD (Docker-in-Docker) installation script to officially support Amazon Linux 2023. It introduces specific package management commands (dnf) and cleanup routines for this new version, while also refactoring existing installation logic for jq to be more robust across different Amazon Linux releases. Additionally, the test suite has been updated to include Amazon Linux 2023, ensuring compatibility and proper functionality.

Highlights

  • Amazon Linux 2023 Support: Added specific installation and cleanup logic for Amazon Linux 2023 within the DinD (Docker-in-Docker) setup script.
  • Refactored jq Installation: The jq installation process for Amazon Linux distributions was refactored into a dedicated function to handle version-specific package managers (dnf for AL2023, yum for others).
  • Amazon Linux Cleanup: Introduced a new function, clean_after_install_amazon, to perform appropriate cleanup actions, specifically dnf clean all for Amazon Linux 2023.
  • Expanded Test Coverage: The test suite was updated to include Amazon Linux 2023 as a base image and refined the conditions for skipping tests on ARM64 for older Amazon Linux versions.
Changelog
  • utils/dind/install-dind.sh
    • Implemented dnf -y install docker for Amazon Linux 2023 within the install_dockerd_amazon function.
    • Modified install_jq to delegate Amazon Linux jq installation to a new function, install_jq_amazon.
    • Created install_jq_amazon to conditionally use dnf for Amazon Linux 2023 and yum for other Amazon Linux versions.
    • Added clean_after_install_amazon to perform dnf clean all for Amazon Linux 2023.
    • Updated clean_after_install to invoke clean_after_install_amazon for Amazon Linux distributions.
  • utils/dind/tests/Earthfile
    • Included amazonlinux:2023 in the all target's base_image list for comprehensive testing.
    • Adjusted the test-install-dind-for-image rule's IF condition to specifically skip amazonlinux:1 or amazonlinux:2 on linux/arm64 platforms.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gilescope gilescope requested a review from janishorsts March 2, 2026 06:22
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for installing Docker-in-Docker on Amazon Linux 2023. The changes correctly use dnf for package management on this new OS version, and update the test matrix accordingly. My review includes a suggestion to refactor duplicated code into a helper function to improve maintainability.

}

install_jq_amazon() {
version=$(sed -n -e 's/^VERSION="\?\([^\"]*\)"\?/\1/p' /etc/os-release)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command to get the Amazon Linux version is duplicated in install_dockerd_amazon, install_jq_amazon, and clean_after_install_amazon. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, this logic should be extracted into a helper function. This new function can then be called from all three places.

For example, you could add a helper function:

get_amazon_version() {
    sed -n -e 's/^VERSION=\"\?([^\"]*)\"\?/\1/p' /etc/os-release
}

And then call it like this:

version=$(get_amazon_version)

This change should also be applied to install_dockerd_amazon and clean_after_install_amazon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant